<?php
declare (strict_types = 1);

namespace app\api\model\v1;

use think\Model;

/**
 * @mixin \think\Model
 * 每天上传的记录
 */
class TopicUserDay extends AppModel
{
    //


    public function user(){
        return $this->belongsTo(Users::class,'user_id')->field('id,username,head_img');
    }
    public function removeUser(){
        return $this->belongsTo(Users::class,'user_id')->field('id,username,head_img')->removeOption('soft_delete');
    }

    public function unit(){
        return $this->belongsTo(Unit::class,'unit_id')->field('id,unit_title,level');
    }

    public function topic(){
        return $this->hasMany(TopicExerciseLog::class,'topic_user_day_id');
    }
}
